package cn.imu.appdevexperiment2020._3activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;

import cn.imu.appdevexperiment2020.R;
import cn.imu.appdevexperiment2020.common.BaseActivity;

/**
 * 描述:
 *
 * @author chenconghua
 * @version 1.0
 * @create 2022-11-13 13:33
 */
public class NewsContentActivity  extends BaseActivity {


   public static void actionStart(Context context,String newsTitle,String newsContent){
      Intent intent =new Intent(context,NewsContentActivity.class);
      intent.putExtra("news_title",newsTitle);
      intent.putExtra("news_content",newsContent);
      context.startActivity(intent);
   }

   @Override
   protected void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.news_content);
      String newsTitle=getIntent().getStringExtra("news_title");
//      String newsTitle="ccc";
//      String newsContent = "ddd";
      String newsContent = getIntent().getStringExtra("news_content");
      NewsContentFragment newsContentFragment = (NewsContentFragment) getSupportFragmentManager().findFragmentById(R.id.news_content_fragment);
      newsContentFragment.refresh(newsTitle,newsContent);
   }
}
